<template>
  <van-nav-bar
      title="寄存系统"
      left-arrow
      @click-left="onClickLeft"
      @click-right="onClickRight">
    <template #right>
      <van-icon name="plus" size="18"/>
    </template>
  </van-nav-bar>

  <router-view/>

  <van-tabbar route>
    <van-tabbar-item to="/info" icon="home-o" name="info">信息</van-tabbar-item>
    <van-tabbar-item to="/entrust" icon="search" name="entrust">邮寄</van-tabbar-item>
    <van-tabbar-item to="/user" icon="friends-o" name="user">个人</van-tabbar-item>
  </van-tabbar>
</template>

<script setup>
import route from '../config/route'
import {onMounted} from "vue";
import {currentUser} from "../config/globalConfig";

const onClickLeft = () => {
  route.back()
}
const onClickRight = () => {
  route.push("/address")
}

onMounted(() => {
  const user = window.localStorage.getItem('currentUser');
  Object.assign(currentUser, JSON.parse(user));
})

</script>

<style scoped>

</style>